import java.awt.event.*;  

float y;  

void setup() {  
  size(400,400);  
  // add mouse wheel listener  
  frame.addMouseWheelListener(new MouseWheelInput());  
  y=height/2;  
}  

void draw() {  
  background(100);  
  ellipse(width/2, y, 50,50);  
}  

// convenience class to listen for MouseWheelEvent  
// modify mouseWheelMoved() for your own purposes  

class MouseWheelInput implements MouseWheelListener{  
  void mouseWheelMoved(MouseWheelEvent e) {  
    int step=e.getWheelRotation(); 
    println(step+" "+millis()); 
    y=y+step*10;  
  }  
}

